var basic = '/FK_portals_cq';
//电子档案
var dzda="http://127.0.0.1/dzda_cq/index.do?method=checkpki";
//轨迹监测
var gjjc="http://127.0.0.1/FK_track_cq/user/remoteIndexPKI.htm";
//线索核查
var xshc="http://127.0.0.1/ClueInfoMgrSystem_cq/login.do?state=remoteLogin";
//权限管理
var qxgl="http://127.0.0.1/FK_portals_maintain_cq/login/login.yw?state=remoteLogin";
//安全审计
var aqsj="http://127.0.0.1/FK_SECURITYAUDIT_cq/PKITologin?state=remoteLogin";
//图析研判
var txyp = "http://127.0.0.1";
//重点阵地
var zdzd="http://127.0.0.1/FK_front_nx/user/toIndexPage";
var test="http://192.168.191.1:8080/FK/u.html"+"?";
var urlObj={
	"dzda":dzda,
	"gjjc":gjjc,
	"xshc":xshc,
	"qxgl":qxgl,
	"aqsj":aqsj,
	"txyp":txyp,
	"zdzd":zdzd,
	"test":test
};


//链接跳转
var goToUrl = function (url) {

	if (url == 'dzda' || 		//电子档案
		url == 'gjjc' || 		//轨迹监测
		url == 'xshc' || 		//线索核查
		url == 'qxgl' || 		//权限管理
		url == 'aqsj' ||		//安全审计
		url == 'txyp' ||
		url == 'zdzd' ||
		url == 'test'
		//图析研判
		//TODO 在此加入新的地址
	) {
		// jumppage(urlObj[url], navsenddata, '_blank');
	}
	jumppage(urlObj[url], navsenddata, '_blank');
}

//初始化系统菜单
var showSystemMenu = function (content) {
	var yjMenu_htm = ""; //总导航栏
	var dzdaMenu_htm = "";//电子档案导航栏
	var fkywMenu_htm = "";//反恐业务导航栏
	var fxypMenu_htm = "";//分析研判导航栏
	var xtglMenu_htm = "";//系统管理导航栏

	//电子档案
	if (("," + content + ",").indexOf(",FK_yyzx_dzda,") > -1) {
		yjMenu_htm += '<li  class="onemenu">' +
			'<span class="img-logo menu-dzda"></span>' +
			'<span class="">电子档案</span>' +
			'<ul class="twomenu" id="dzda-menu">';
		if (("," + content + ",").indexOf(",FK_gzrydzda_cq,") > -1) {
			dzdaMenu_htm += '<a onclick="goToUrl(\'gjjc\')"><li>关注人员电子档案</li></a>';
		}
		yjMenu_htm += '</ul>' +
			'</li>';
	}
	//反恐业务
	if (("," + content + ",").indexOf(",FK_fkyw_cq,") > -1) {
		yjMenu_htm += '<li  class="onemenu">' +
			'<span class="img-logo menu-fkyw"></span>' +
			'<span class="">反恐业务</span>' +
			'<ul class="twomenu" id="fkyw-menu">';
		if (("," + content + ",").indexOf(",FK_zllzglxt_cq,") > -1) {
			fkywMenu_htm += '<a onclick="goToUrl(\'dzda\')"><li>指令流转管理系统</li></a>';
		}
		if (("," + content + ",").indexOf(",FK_gzrydzda_cq,") > -1) {
			fkywMenu_htm += '<a onclick="goToUrl(\'gjjc\')"><li>信息反馈</li></a>';
		}
		yjMenu_htm += '</ul>' +
			'</li>';
	}
	//系统管理
	if (("," + content + ",").indexOf(",FK_xtgl,") > -1) {
		yjMenu_htm += '<li  class="onemenu">' +
			'<span class="img-logo menu-yygl"></span>' +
			'<span class="">系统管理</span>' +
			'<ul class="twomenu" id="xtgl-menu">';
		if (("," + content + ",").indexOf(",FK_xtgl_FK_portals_maintain,") > -1) {
			xtglMenu_htm += '<a onclick="goToUrl(\'qxgl\')"><li>权限管理</li></a>';
		}
		yjMenu_htm += '</ul>' +
			'</li>';
	}
	$("#all-menu").html(yjMenu_htm);
	$("#dzda-menu").html(dzdaMenu_htm);
	$("#fkyw-menu").html(fkywMenu_htm);
	$("#xtgl-menu").html(xtglMenu_htm);
}

var jumppage = function(url,params,target,encodable){
    if(url!=undefined&&url!=""){
        if(target==undefined||target==""){
            target="";
        }
        if(encodable==true){
            url=encodeURI(url);
        }
        var formid=+new Date();
        var form="";
        form+="<form id='"+formid+"' action='"+url+"' method='post' style='display:none;' target='"+target+"'>";
        if(params!=undefined){
            for(var p in params){
                form+="<input type='hidden' name='"+p+"' value='"+params[p]+"' />";
            }
        }
        form+="<form>";
        $("body").append(form);
        $("#"+formid).submit();
        $("#"+formid).remove();
    }else{
        console.log("请求失败，请检查FORMSUBMIT所需参数合法性！");
    }
}